<?php

/**
 * Login page
 *
 * @since ADD-ADOdb-Admin 0.0
 */
CLASS ctrl_page_login EXTENDS ctrl_tpl_adodb_admin {

   protected $data = array(
         'adodb_types' => array(
               'mysql','mssql','odbc_mssql',
            ),
      );

   protected $mode_gpc_login = array(
         '_POST' => array('type','host','username','password','database')
      );

   /**
    * Login mode
    *
    * @since ADD-ADOdb-Admin 0.0
    */
   public function process_mode_login($gpc) {
      extract($gpc);

      if (adodb_user::login($type,$host,$username,$password,$database)) {
         add::redirect(add::config()->path);
      }
   }

}